home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 770 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.9 KB

  1. From: Alexander Krotoff <krotoff@boy.nmd.msu.ru>
  2. Message-ID: <199603181242.PAA14998@boy.nmd.msu.ru>
  3. X-Original-Date: Mon, 18 Mar 1996 15:42:37 +0300
  4. Path: in2.uu.net!bounce-back
  5. Date: 18 Mar 96 23:28:27 GMT
  6. Approved: fjh@cs.mu.oz.au
  7. Subject: two scope rules questions
  8. Newsgroups: comp.std.c++
  9. Organization: Research Computer Center, Moscow State University
  10. Reply-To: krotoff@such.srcc.msu.su
  11. X-Auth: PGPMoose V1.1 PGP comp.std.c++
  12.     iQBFAgUBMU3xo+EDnX0m9pzZAQF3JgF+LLfGLcqzBIbQYQq8A8C3mUPLzVrd0i4h
  13.     W9ZngqCCl+NfhWWWUnC7Yvj7dHdRpOpN
  14.     =1y52
  15.  
  16. Hello, c++ gurus.
  17.  
  18. I have 2 questions about scope rules.
  19.  
  20. The first one: if typedef-name names unnamed class, it became class-name.
  21. Is it typedef-name also ?
  22.  
  23. Example:
  24. enum en {
  25.     X =1;
  26. };
  27.  
  28. typedef class {
  29.     int a;
  30. } X;
  31.  
  32. X becomes class-name.
  33. If it is typedef-name also, this example is not well-formed. 
  34. If if is not typedef-name, the example is well-formed, but,
  35. since we cannot use `class X' this class name is always hidden
  36. by enumerator name and could not be accessed.
  37.  
  38. The second question: in ARM (9.9) and in early versions of WP
  39. (Feb 11, 1991) it was a section "Local type names" with few
  40. wery puzzling examples (example 2 in the WP 1991). The current
  41. edition of the section is much shorter, and do not cover examples
  42. from ARM. Are these rules deleted, or just moved to any general
  43. section ? Are examples from ARM still be incrorrect according to
  44. current WP ?
  45.  
  46. Thank you in advance.
  47.  
  48. --
  49. Alexander N. Krotoff        krotoff@such.srcc.msu.su
  50. Research Computer Center    tel: +7(095)939-2638
  51. Moscow State University        fax: +7(095)939-4430
  52. ---
  53. [ comp.std.c++ is moderated.  To submit articles: try just posting with      ]
  54. [ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu         ]
  55. [ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
  56. [ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
  57. [ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]
  58.